﻿@model object
@{
    Type tModel = ViewData.ModelMetadata.ContainerType.GetProperty(ViewData.ModelMetadata.PropertyName).PropertyType;
}
@if(typeof(string).IsAssignableFrom(tModel)) {
    @Html.DevExpress().TextBox(s => {
        s.Name = ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("");
    }).Bind(Model).GetHtml();
}
else if(typeof(Enum).IsAssignableFrom(tModel)) {
    Html.DevExpress().ComboBox(s => {
        s.Name = ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("");
        s.Properties.Items.AddRange(Enum.GetValues(tModel));
        s.SelectedIndex = 0;
        s.Properties.DropDownStyle = DropDownStyle.DropDownList;
    }).Bind(Model).GetHtml();
} 